package com.mc.read.adminapi.controller;

import com.mc.read.adminapi.service.BooksService;
import com.mc.read.vo.request.BaseRequest;
import com.mc.read.vo.respose.BaseRespose;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author liuhao
 * @date 2019/6/14 10:09
 */
@Controller
@RequestMapping(value = "/verify/book")
@Slf4j
public class BooksController {
    @Autowired
    BooksService booksService;

    /**
     * @Author:LiuHao
     * @Date:15:24 2019/5/31
     * 查询书籍类型 selectBookType
     **/
    @ResponseBody
    @RequestMapping(value = "selectBookType", method = RequestMethod.POST)
    public BaseRespose selectBookType(@RequestBody BaseRequest baseRequest) {
        BaseRespose baseRespose = booksService.selectBookType(baseRequest);
        return baseRespose;
    }

    /**
     * @Author:LiuHao
     * @Date:15:24 2019/5/31
     * 添加书籍类型 addBookType
     **/
    @ResponseBody
    @RequestMapping(value = "addBookType", method = RequestMethod.POST)
    public BaseRespose addBookType(@RequestBody BaseRequest baseRequest) {
        BaseRespose baseRespose = booksService.addBookType(baseRequest);
        return baseRespose;
    }

    /**
     * @Author:LiuHao
     * @Date:15:24 2019/5/31
     * 删除书籍类型 deleteBookType
     **/
    @ResponseBody
    @RequestMapping(value = "deleteBookType", method = RequestMethod.POST)
    public BaseRespose updateBookType(@RequestBody BaseRequest baseRequest) {
        BaseRespose baseRespose = booksService.deleteBookType(baseRequest);
        return baseRespose;
    }

    /**
     * @Author:LiuHao
     * @Date:15:24 2019/5/31
     * 选择书籍类型 chooseBookType
     **/
    @ResponseBody
    @RequestMapping(value = "chooseBookType", method = RequestMethod.POST)
    public BaseRespose chooseBookType(@RequestBody BaseRequest baseRequest) {
        BaseRespose baseRespose = booksService.chooseBookType(baseRequest);
        return baseRespose;
    }


    /**
     * @Author:LiuHao
     * @Date:15:24 2019/5/31
     * 查询书籍列表 selectBookList
     **/
    @ResponseBody
    @RequestMapping(value = "selectBookList", method = RequestMethod.POST)
    public BaseRespose selectBookList(@RequestBody BaseRequest baseRequest) {
        BaseRespose baseRespose = booksService.selectBookList(baseRequest);
        return baseRespose;
    }

    /**
     * @Author:LiuHao
     * @Date:15:24 2019/5/31
     * 查询书籍标签 selectBookLabel
     **/
    @ResponseBody
    @RequestMapping(value = "selectBookLabel", method = RequestMethod.POST)
    public BaseRespose selectBookLabel(@RequestBody BaseRequest baseRequest) {
        BaseRespose baseRespose = booksService.selectBookLabel(baseRequest);
        return baseRespose;
    }

    /**
     * @Author:LiuHao
     * @Date:15:24 2019/5/31
     * 删除书籍标签 deleteBooklabel
     **/
    @ResponseBody
    @RequestMapping(value = "deleteBooklabel", method = RequestMethod.POST)
    public BaseRespose deleteBooklabel(@RequestBody BaseRequest baseRequest) {
        BaseRespose baseRespose = booksService.deleteBooklabel(baseRequest);
        return baseRespose;
    }

    /**
     * @Author:LiuHao
     * @Date:15:24 2019/5/31
     * 修改书籍 updateBookInfo
     **/
    @ResponseBody
    @RequestMapping(value = "updateBookInfo", method = RequestMethod.POST)
    public BaseRespose updateBookInfo(@RequestBody BaseRequest baseRequest) {
        BaseRespose baseRespose = booksService.updateBookInfo(baseRequest);
        return baseRespose;
    }

    /**
     * @Author:LiuHao
     * @Date:15:24 2019/5/31
     * 添加书籍 addBook
     **/
    @ResponseBody
    @RequestMapping(value = "addBook", method = RequestMethod.POST)
    public BaseRespose addBook(@RequestBody BaseRequest baseRequest) {
        BaseRespose baseRespose = booksService.addBook(baseRequest);
        return baseRespose;
    }

    /**
     * @Author:LiuHao
     * @Date:15:24 2019/5/31
     * 删除书籍 deleteBook
     **/
    @ResponseBody
    @RequestMapping(value = "deleteBook", method = RequestMethod.POST)
    public BaseRespose deleteBook(@RequestBody BaseRequest baseRequest) {
        BaseRespose baseRespose = booksService.deleteBook(baseRequest);
        return baseRespose;
    }

    /**
     * @Author:LiuHao
     * @Date:15:24 2019/5/31
     * 添加书籍标签 addBookLabel
     **/
    @ResponseBody
    @RequestMapping(value = "addBookLabel", method = RequestMethod.POST)
    public BaseRespose addBookLabel(@RequestBody BaseRequest baseRequest) {
        BaseRespose baseRespose = booksService.addBookLabel(baseRequest);
        return baseRespose;
    }


    /**
     * @Author:LiuHao
     * @Date:15:24 2019/5/31
     * 书籍审核列表 selectBookAuditList
     **/
    @ResponseBody
    @RequestMapping(value = "selectBookAuditList", method = RequestMethod.POST)
    public BaseRespose selectBookAuditList(@RequestBody BaseRequest baseRequest) {
        BaseRespose baseRespose = booksService.selectBookAuditList(baseRequest);
        return baseRespose;
    }

    /**
     * @Author:LiuHao
     * @Date:15:24 2019/5/31
     * 书籍审核 不通过 bookAuditNoPass
     **/
    @ResponseBody
    @RequestMapping(value = "bookAuditNoPass", method = RequestMethod.POST)
    public BaseRespose bookAuditNoPass(@RequestBody BaseRequest baseRequest) {
        BaseRespose baseRespose = booksService.bookAuditNoPass(baseRequest);
        return baseRespose;
    }

    /**
     * @Author:LiuHao
     * @Date:15:24 2019/5/31
     * 书籍审核 通过 bookAuditPass
     **/
    @ResponseBody
    @RequestMapping(value = "bookAuditPass", method = RequestMethod.POST)
    public BaseRespose bookAuditPass(@RequestBody BaseRequest baseRequest) {
        BaseRespose baseRespose = booksService.bookAuditPass(baseRequest);
        return baseRespose;
    }
    /**
    * @Author:LiuHao
    * @Date:15:24 2019/5/31
    *删除书籍审核记录 deleteBookAudit
    **/
    @ResponseBody
    @RequestMapping(value = "deleteBookAudit", method = RequestMethod.POST)
    public BaseRespose deleteBookAudit(@RequestBody BaseRequest baseRequest) {
         BaseRespose baseRespose = booksService.deleteBookAudit(baseRequest);
         return baseRespose;
     }


}

